#include <stdio.h>
#include <math.h>

int main()
{
	FILE *fp;
	int i,j,k = 0;
/*	fp = fopen("3.1.dat","w");
	if (NULL == fp)
	{
		printf("fail!");
		return 1;
	}
	fprintf(fp,"%d\n%d\n",2,3);
	for (i = 5;i < 1000;i++)
	{
		for (j = 2;j <= sqrt(i);j++)
			if (i%j==0)	break;
		if (j > sqrt(i))
			fprintf(fp,"%d\n",i);
	}

	fclose(fp);
*/
	fp = fopen("3.1.dat","r");
	if (NULL == fp)
	{
		printf("fail!");
		return 1;
	}
	while (fscanf(fp,"%d",&i) != EOF)
	{
	
		fprintf(stdout, "%4d ", i);
		k++;
		if (k%12 == 0)
			printf("\n");
		
	} 
	if ( k%12 != 0)
		printf("\n");
	fclose(fp);
	return 0;
}